function sfMakeIframeNameG(e){return"review_widget"+e}function sfMakeIframeIdG(e){return"review_widget"+e}function sfGetIframeIdG(e){return"review_widget"+e}String.prototype.includes||Object.defineProperty(String.prototype,"includes",{enumerable:!1,value:function(e,t){"use strict";if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)}}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,value:function(e){"use strict";if(null==this)throw new TypeError("Array.prototype.includes called on null or undefined");var t=Object(this),i=parseInt(t.length,10)||0;if(0===i)return!1;var n,r,s=parseInt(arguments[1],10)||0;for(s>=0?n=s:(n=i+s)<0&&(n=0);n-1||e.indexOf("edge/")>-1}function returnClosePopup(e){if(snaputil){for(var t=0;t2?i=s[2]:n=a?.length>1&&a[1]||null,o?.length>2?t=o[2]:(o=/order_view\([^,]+,[^\'\"]+[\'\"](\w+-\w+)/.exec(r),t=o?.length>1&&o[1]||null),t=t&&t.replace(/_\[*([^\]]+)\]*$/,"_[$1]")}else if("makeglobal"==r)t=e.getAttribute("data-order_id"),i=e.getAttribute("data-item_id");else if("godomall"==r){t=e.getAttribute("data-order_id"),i=e.getAttribute("data-item_id");let n=e.getAttribute("data-sno");t&&n&&(t+="_"+n)}return{order_id:t||null,product_id:i||null,product_code:n||null}}this.moveMypageNotiPopup=(()=>{const e={};return(t,i=-90,n=!1)=>{const r=t.offsetWidth;let s=null;if(e[r]??={},s=e[r],n)return t.style.right=snaputil.mypageNotiPopupInitPos;i=Number(i),isNaN(i)||(s[i]??=Math.round(r*(i/100)),t.style.right=s[i]+"px")}})(),this.showHideMallScroll=(e=!0,t="html, body")=>{const i=e?"add":"remove";document.querySelectorAll(t).forEach((e=>e.classList[i]("sr_scroll_off")))},this.showLoadElement=(e=!0,t="html body")=>{const i=document.querySelector(t),n=document.createElement("div");if(e){const e=document.createElement("i");n.classList.add("sf_popup_load_wrapper"),snaputil.setLoadElementStyle(n,"wrapper"),snaputil.setLoadElementStyle(e,"img"),e.classList.add("sf_popup_load_img"),n.append(e),i.append(n)}else i.querySelector(".sf_popup_load_wrapper")?.remove()},this.isTypeof=function(e,t){return typeof t===("string"==typeof e&&e||"undefined")},this.isFunction=this.isTypeof.bind(this,"function"),this.loadOutsideCommonCss=()=>{if(n)return;n=!0;const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href","//cdn.snapfit.co.kr/review/css/outside_common.css?version=2"),document.head.appendChild(e)},this.make_send_data_detail=function(e,t){if(!e||"undefined"===e)return!1;Array.isArray(t)||(t=[]);const i=encodeURIComponent(snaputil.sf_get_device_type()),n={device_type:encodeURIComponent(i),store_username:encodeURIComponent(e)};return t.length?(t.includes("url")&&window.snapData?.itemInfo?.link?n.url=encodeURIComponent(window.snapData.itemInfo.link):n.url=encodeURIComponent(location.href),t.includes("draw_target")&&(n.draw_target=n.device_type),n):n},this.setwidgetidsparam=function(e){let t=document.querySelectorAll(`.snap_widget:not(.${r})`),i=this.originReduce([].slice.call(t),((e,t)=>(e[t.getAttribute("id")]=1,e)),{});i=Object.keys(i),i.length>0&&(e.review_usewidgets=i)},this.decode_json=function(e){try{return JSON.parse(e)}catch(e){return!1}},this.isIOS=function(){return null!=navigator.userAgent.match(/iPhone|iPod|iPad/i)},this.getVersionIOS=function(){var e=window.navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);return e=e&&"object"==typeof e&&e[1]||-1,Number(e)},this.chunk=function(e,t){t=t||0;var i,n=[];for(i=0;i-1||t.indexOf("edge/")>-1))return t.indexOf("safari")>-1?t.indexOf("Opera")>-1?(console.log("not support opr"),!1):t.indexOf("chrome")>-1?(console.log("chrome"),!0):(console.log("safari"),!0):t.indexOf("firefox")>-1?(console.log("firefox"),!0):(console.log("unknow browser"),!0);if(e="ie","Microsoft Internet Explorer"!==i)return t.indexOf("trident")>-1?e+=11:t.indexOf("edge/")>-1&&(e="edge"),console.log("support"+e),!0;var n=null,r="";if("Microsoft Internet Explorer"==navigator.appName)r="msie ";else if(t.search("trident")>-1)r="trident/.*rv:";else{if(!(t.search("edge/")>-1))return!1;r="edge/"}return null!=new RegExp(r+"([0-9]{1,})(\\.{0,}[0-9]{0,1})").exec(t)&&(n=RegExp.$1+RegExp.$2),n<9?(console.log("not support ie version:"+t),!1):void 0},this.isvalid=function(e){return!(!e||!1===e||"false"==e||""==e||null==e||void 0===e||"null"==e||"undefined"==e||null==e||e.length<=0)},this.isElement=e=>e instanceof HTMLElement,this.make_param_url=function(e){var t="";for(var i in e)""!=t&&(t+="&"),t+=i+"="+e[i];return snaputil.snaprxs(t)},this.insertAfter=function(e,t){this.isElement(e)&&this.isElement(t)&&this.isElement(e.parentNode)&&(this.isElement(e.nextSibling)?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t))},this.draw_iframe_default_add_paramurl=function(e,t,i,n,r,s,a,o,l,d){this.draw_iframe_default(e,t,i,n,r,s,a,o,l,d)},this.draw_iframe_default=function(e,t,i,n,r,s,a,o,l,d){this.draw_iframe(e,t,i,n,r,s,"0","0","no",0,0,0,0,a,o,l,d)},this.draw_iframe=function(e,t,i,n,s,a,o,l,d,u,p,l,c,f,_,m,h){if(!t||!f)return null;if(e="object"==typeof e&&e||{},0==this.isvalid(m))if("fit"==_)m=[document.getElementById(t)];else{let e=document.querySelectorAll(`.snap_widget:not(.${r})[id='${t}']`);m=Array.prototype.slice.call(e)}else 0==Array.isArray(m)&&(m=[m]);let g=n==sfMakeIframeNameG(2);if(this.isvalid(m)){let t=window.location.href;for(let _=0;_e&&"object"==typeof e&&Object.entries(e).map((e=>e.join("="))).join("&")||"",this.sendHttpRequest=function(e,t,i){const n={method:"POST",cache:"no-cache",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:snaputil.objectToQueryString(t)};try{window?.snap_csrf_token&&(n.headers["X-CSRF-TOKEN"]=window.snap_csrf_token)}catch(e){}fetch(e,n).then((e=>snaputil.isFunction(e?.json)&&e.json())).then((e=>snaputil.isFunction(i)&&i(e)))},this.reload_iframe=function(e){e&&e.dataset.url&&snaputil.snapreview_sf_post_to_resultviewmessage({e:"refresh_widget",solutiontype:"snap_review",data:{dac:"tibb"}},e.getAttribute("id"))},this.drawIframePopup=e=>{if(!e||"object"!=typeof e)return null;const t=e.url??"",i=e.id??"snap_popup_iframe",n=e.name??"snap_popup_iframe",r=e.value??"",s=e.parent??"",a=e.width??"100%",o=e.height??"100%",l=e.position??{top:0,left:0},d=e.transform??"none",u=e.isHideMallScroll??!0,p=e.addHash??null,c=e.isIframeFullPopup??!0,f=e.isHashChange&&location.hash==`#${s}`||!1,_="object"==typeof e.params&&e.params||{};let m=document.querySelector(`#${i}`);if(!t)return null;if(m)return null;u&&snaputil.showHideMallScroll(),m=document.createElement("iframe"),m.setAttribute("id",i),m.setAttribute("name",n),m.setAttribute("value",r),m.setAttribute("data-parent",s),m.setAttribute("data-ifp",c?1:0),m.style.width=a,m.style.height=o,m.style.border="none",m.style.position="fixed",m.style.opacity="0",m.style.zIndex="99999",m.style.transform=d||"none",m.style.transition="opacity 0.5s linear";for(const e in l)m.style[e]=l[e]||0;return m.allowtransparency=!0,m.frameborder=0,Object.keys(_).length?(m.setAttribute("data-url",t),m.setAttribute("data-params",JSON.stringify(_))):m.src=this.snaprxs(encodeURI(t)),document.body.appendChild(m),p&&m.addEventListener("load",(()=>snaputil&&snaputil.add_url_hash(p,f))),snaputil.formSubmit({action:t,target:n,datas:_}),m},this.errorEvent=function(e){const t=new CustomEvent("error",{detail:{reason:"timeout",message:"Timeout Error !"}});e.dispatchEvent(t)},this.draw_iframe_full_popup=function(e){if(!e||"object"!=typeof e)return!1;const t=snaputil.sf_get_innertext("solutiontype");"makeshop"!==t&&snaputil.showLoadElement();let i=e.url||"",n=e.id||"snap_popup_full_iframe",r=e.name||"snap_popup_full_iframe",a=e.value||"",o=e.parent||"",l=e.addHash||null,d=e.isHashChange&&location.hash=="#"+o,u="object"==typeof e.post&&e.post||{};if(!i)return!1;if(document.querySelector("#"+n))return!1;snaputil.showHideMallScroll();let p=document.createElement("iframe");return p.setAttribute("id",n),p.setAttribute("name",r),p.setAttribute("value",a),p.setAttribute("data-ifp",1),p.setAttribute("data-parent",o),p.style.width="100%",p.style.height="100%",p.style.zIndex="99999",p.style.position="fixed",p.style.left="0px",p.style.right="0px",p.style.top="0px",p.style.bottom="0px",p.style.border="0px solid white",p.style.backgroundColor="rgba(0, 0, 0, 0.05)",p.style.transition="opacity 0.5s linear",p.style.opacity="0",p.allowtransparency=!0,p.frameborder=0,Object.keys(u).length?(p.setAttribute("data-url",i),p.setAttribute("data-params",JSON.stringify(u))):p.src=this.snaprxs(encodeURI(i)),document.body.appendChild(p),"makeshop"!==t&&(s=setTimeout((()=>{snaputil.errorEvent(p)}),15e3),p.addEventListener("error",(function(){p.remove(),snaputil.disableLoading(),snaputil.showHideMallScroll(!1),alert("죄송합니다. 로드에 일시적인 오류가 발생했습니다.")}))),l&&p.addEventListener("load",(function(){snaputil&&snaputil.add_url_hash(l,d)})),snaputil.formSubmit({action:i,target:r,datas:u}),p},this.redirect_url=function(e,t){return!!e&&(e=e.replace(/^(https?:)?\/\//,window.location.protocol+"//"),t="object"==typeof t&&t||{},Object.keys(t).length?snaputil.formSubmit({action:e,datas:t}):void(window.location.href=e))},this.formSubmit=function(e){if(e&&e.action){var t,i=document.createElement("form"),n=e.method||"post",r="object"==typeof e.datas&&e.datas||{},s=e.target||null;for(key in i.setAttribute("action",e.action),i.setAttribute("method",n),s&&i.setAttribute("target",s),r)(t=document.createElement("input")).setAttribute("name",key),t.setAttribute("value",r[key]),i.appendChild(t);document.body.appendChild(i),i.submit(),i.parentNode.removeChild(i)}},this.window_open=function(e){e&&window.open(e)},this.snapreview_sf_post_to_resultviewmessage=function(e,t){var i=snaputil.reviewobj&&window||function getIframeWindow(e){return e&&(e=document.getElementById(e))&&e.contentWindow||null}(t);return e="string"!=typeof e&&JSON.stringify(e)||e,!(!i||!e)&&i.postMessage(e,"*")},this.sf_get_user_id=function(){const e=document.getElementsByClassName("xans-member-var-id");return e?.length<=0?null:e[0].innerText||e[0].textContent},this.sf_get_value=function(e){var t=document.getElementById(e);return t&&t.value||null},this.sf_get_device_type=function(){var e=document.getElementById("sf_draw_type");return e?("responsive"===e.value&&(e.value=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"mobile":"pc"),e.value):null},this.isPC=()=>"pc"===snaputil.sf_get_device_type(),this.sf_get_innertext=function(e){var t=document.getElementById(e);return t&&t.innerText||null},this.get_nem_id=function(e){return new Promise(((t,i)=>{let n=0;const r=setInterval((()=>{const i=snaputil.GetSnapNemIdG(e),s=i&&"undefined"!==i;15===n&&console.log("slow nem"),++n,!s&&n<17||(clearInterval(r),t(s&&i||null))}),200)}))},this.get_user_id=function(e){return new Promise(((t,i)=>{let n=0;const r="cafe24"===e,endInterval=(e,i)=>(clearInterval(e),t(i)),s=setInterval((()=>{let e=snaputil.sf_get_user_id();const t=null!==e;if(t&&t&&e&&"undefined"!==e)return endInterval(s,e);if(!r)return endInterval(s,null);if(n>15)return endInterval(s,null);if(!t)return endInterval(s,null);if(window?.CAPP_ASYNC_METHODS?.IS_LOGIN&&window?.CAPP_ASYNC_METHODS?.member){if(e=window.CAPP_ASYNC_METHODS.member.getData()?.member_id,!e)return;return endInterval(s,e)}++n}),200)}))},this.send_init=async function(e,t){const i=snaputil.GetSafeDicValue(t,"device_type"),n=snaputil.sf_get_innertext("solutiontype"),r=await snaputil.get_nem_id(i),s=await snaputil.get_user_id(n);return r&&(t.nemid=r),s&&(t.user_id=s),await snaputil.postForm({url:e,body:t})},this.add_url_hash=function(e,t){if(e&&-1===window.location.hash.indexOf(e)){var i=this.check_hashes.length;isIE()||t?(history.replaceState(...this.getPopupHashParamater(e)),this.check_hashes.pop()):history.pushState(...this.getPopupHashParamater(e)),0==i&&window.addEventListener("hashchange",returnClosePopup,!1),this.check_hashes.push(e)}},this.history_back=function(){if(isIE()){var e=snaputil.check_hashes.length;e&&(snaputil.close_popup(snaputil.check_hashes[e-1]),this.check_hashes.pop())}else history.back()},this.close_popup=function(e){var t=document.getElementById(e);if(t&&null!==t.getAttribute("data-ifp")){const i=t.parentNode,n=t.getAttribute("data-parent")??"",r=document.getElementById(n),s=sfMakeIframeIdG(snaputil.WIDGET_TYPE.MYPAGE_NOTI_POPUP),a=!!Number(r?.dataset?.ifp??!1),realCloseProcess=()=>{i.removeChild(t),snaputil.showHideMallScroll(a),r&&r?.focus()},o=document.querySelectorAll("iframe[id^='review_widget']");if(o.length&&o.forEach((e=>{var t=e.id;snaputil.snapreview_sf_post_to_resultviewmessage({e:"popup-close",solutiontype:"snap_review"},t)})),window.postMessage({type:"popup-close",solutiontype:"snap_review"},"*"),i)if(snaputil.isPC()&&s===n){const e=document.getElementById(s);if(!e)return realCloseProcess();t.ontransitionend=()=>{snaputil.moveMypageNotiPopup(e,null,!0),realCloseProcess()},t.classList.add(snaputil.opacityZeroClassName)}else snaputil.isPC()&&s===e?(t.ontransitionend=realCloseProcess,snaputil.moveMypageNotiPopup(t,-100)):realCloseProcess()}},this.addCommaForPrice=function(e){return e.toString().replace(/\D/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,",")},this.updateReviewCountInfos=function(e,t){if(e&&t){var i=this.sf_get_innertext("solutiontype"),n=document.querySelectorAll(e);if(n&&n.length>0)for(var r=0;r0){var a=null,o=null;"cafe24"==i?(a=/(product_no=|product\/[^\/]+\/)([^\/&#]+)/.exec(s[0]))&&a.length>2&&(o=a[2]):"makeshop"==i?(a=/branduid=([^&#]+)/.exec(s[0]))&&a.length>1&&(o=a[1]):"makeglobal"==i?(a=/pid\/([^\/&#]+)/.exec(s[0]))&&a.length>1&&(o=a[1]):"godomall"==i&&(a=/goodsNo=([^&#]+)/.exec(s[0]))&&a.length>1&&(o=a[1]);var l=n[r].querySelector(".snap_review_count");o&&l&&l.setAttribute("snap_item_id",o)}}}},this.addReviewWriteButtons=function(e,t,i){e=e||this.writeBtnSelectors.itemSelector||"",t=t||this.writeBtnSelectors.dataSelector||"",i=i||this.writeBtnSelectors.targetSelector||"",e&&t&&i&&(this.writeBtnSelectors.itemSelector=e,this.writeBtnSelectors.dataSelector=t,this.writeBtnSelectors.targetSelector=i,[].slice.call(document.querySelectorAll(e+":not(.set)")).map((function(e){var n=e.querySelector(t),r=e.querySelector(i),s=n&&n.getAttribute("onclick")||null;r&&s&&(r.setAttribute("data-detail",s),r.setAttribute("href","#"),r.setAttribute("class",r.getAttribute("class")+" snap_review_write_btn"))})))},this.updateReviewWriteButtons=function(e){this.writeParams="object"==typeof e&&e||this.writeParams,e=this.writeParams,this.addReviewWriteButtons();let t=document.querySelectorAll(".snap_review_write_btn:not(.set)");if(t?.length){let e=[];for(btn of t){btn.style.display="none";let t=getOrderInfoInWriteButton(btn).order_id;t&&e.push(t)}e&&snaputil.getDisplayWriteButtons(e)}},this.updateItemReviewWriteButtons=function(){var e=document.querySelectorAll(".snap_item_review_write_btn");if(e&&e.length)for(var t=0;te.json())).then((e=>snaputil.setDisplayWriteButtons(e)))},this.setDisplayWriteButtons=function(e){if(!e||!e?.success)return null;let t=document.querySelectorAll(".snap_review_write_btn:not(.set)");if(!t?.length)return null;let i=e?.data||{},n=i.writableOrders||{},r=i.unwritableOrders||{},s=this.writeParams;for(const e of t){let t=!1,i=getOrderInfoInWriteButton(e),a=i.order_id,o=i.product_id;for(const[i,r]of Object.entries(n)){let s=!o||r==o;if(i.indexOf(a)>-1&&s){e.style.display="",delete n[i],t=!0;break}}if(!t)for(const e of Object.entries(r))if(e.indexOf(a)>-1){delete r[e],t=!0;break}t&&(e.onclick=function(e){let t=getOrderInfoInWriteButton(this);if(t.order_id){let e=s;for(key in t)t[key]&&(e[key]=t[key]);snaputil.draw_iframe_full_popup({url:snaputil.writeUrl,post:e,id:sfMakeIframeIdG(snaputil.WIDGET_TYPE.WRITE_REVIEW),name:sfMakeIframeNameG(snaputil.WIDGET_TYPE.WRITE_REVIEW),addHash:sfMakeIframeIdG(snaputil.WIDGET_TYPE.WRITE_REVIEW)})}e.preventDefault()},e.classList.add("set"))}},this.get_postmessage_form=function(e,t){return postmessage={e:e,data:t,solutiontype:"snap_review"}};var scrollEvent=function(){snaputil.snapTicking||(snaputil.snapTicking=!0,window.requestAnimationFrame?window.requestAnimationFrame(checkScrollEvent):setTimeout(checkScrollEvent,20))};function checkScrollEvent(){!function readyScrollWidget(){for(var e=Object.keys(snaputil.scrollReadyWidgets),t=0;t[{data:"",type:"popup",widgetId:e},"",`#${e}`],this.closeGrandParentPopup=(e,t)=>new Promise(((i,n)=>{try{const n=document.getElementById(e),r=n?.dataset?.parent??null,s=r&&document.getElementById(r)||null;let a=0,o=grandParentEleIdx=null;if(null===s||null===n||r!==t||!1===Object.hasOwn(s.dataset??{},"ifp"))return i();for(const e of document.body.querySelectorAll("iframe[id^='review_widget'][data-ifp]")){if(e===s&&(grandParentEleIdx=a)||e===n&&(o=a),null!==o&&null!==grandParentEleIdx)break;++a}if(grandParentEleIdx>o)return i();s.remove();const popStateListener=r=>{const s=r.state??{};"popup"===(s.type??"")&&t===(s.widgetId??"")&&(n.classList.add(this.NO_CLOSE_CLASS_NAME),history.replaceState(...this.getPopupHashParamater(e)),window.removeEventListener("popstate",popStateListener),window.addEventListener("hashchange",returnClosePopup,!1),i())};window.removeEventListener("hashchange",returnClosePopup,!1),window.addEventListener("popstate",popStateListener),this.check_hashes.splice(-2,1),history.back()}catch(e){console.error(e),n(e)}})),this.snap_sfreview_receiveMessage=async function(e){try{var t=(s=e.data)&&snaputil.decode_json(s)||{},i=t.e,n=t.solutiontype,s=t.data,a=this===snaputil;if(a&&-1==e.origin.indexOf("snapvi")&&-1==e.origin.indexOf("snapfit"))return;if(!Boolean(s)||!Boolean(i)||"snap_review"!=n)return;if("snapreview_popup"==i){if(!s.id||!s.src)return;var o=sfMakeIframeIdG(s.id??""),l=sfMakeIframeNameG(s.id??""),d=sfMakeIframeIdG(s.parent??""),u=document.getElementById(o),p=s.src??"",c=e.currentTarget.document.activeElement,f=c.id||"snapfit_resultview_iframe",_=s.is_close??!1,m={url:p,post:s.post??{},id:o,name:l,value:f,parent:d,addHash:o,isHashChange:_};if(_){var h=document.getElementById(d);void 0!==h&&null!=h&&("makeshop"!==snaputil.sf_get_innertext("solutiontype")&&snaputil.disableLoading(),snaputil.close_popup(d))}if(null!==u&&2===Number(s.version??1)&&(u=null,await snaputil.closeGrandParentPopup(d,o)),void 0!==u&&null!=u)return;if(snaputil.isPC()&&sfMakeIframeIdG(this.WIDGET_TYPE?.MYPAGE_NOTI_POPUP??snaputil.WIDGET_TYPE.MYPAGE_NOTI_POPUP)===f){const e=snaputil.draw_iframe_full_popup(m);e.classList.add(snaputil.opacityZeroClassName),c.ontransitionend=()=>{e.classList.remove(snaputil.opacityZeroClassName),c.ontransitionend=""},snaputil.moveMypageNotiPopup(c)}else snaputil.draw_iframe_full_popup(m);if(a){if(f){const e=document.querySelectorAll("iframe[id^='review_widget']");e.length&&e.forEach((e=>{var t=e.id;snaputil.snapreview_sf_post_to_resultviewmessage({e:"popup-open",solutiontype:"snap_review"},t)}))}}else window.postMessage({type:"popup-open",solutiontype:"snap_review"},"*")}else if("snapreview_send_message"==i){var g=(x=s.data||{}).platform||null,w=(B=(R=(k=s.id||null)&&sfGetIframeIdG(k)||null)&&document.getElementById(R)||null)&&B.getAttribute("data-parent")||null,v=x.send_type||null,y=x.review_id||null;if(!g||!k)return;if(a)return void(w&&snaputil.snapreview_sf_post_to_resultviewmessage({e:"snapreview_send_message",solutiontype:"snap_review",data:s},w));if("recom"==v){var I=x.recomtype,b=x.recom,E=x.unit;1==I?this.set_recommend_btn("recommend",b,y,E):-1==I?this.set_recommend_btn("not_recommend",b,y,E):this.set_recommend_btn("",b,y,E)}else if("filter"==v){var P=x.filterdata;this.GetData(1,1,P)}}else if("snapreview_resultview_resize"==i){var k=sfMakeIframeIdG(s.widgetid),A=s.width??null,O=s.height||0;if(!(N=document.getElementById(k))||1==N.getAttribute("data-ifp")||O<=40||null!==A&&A<=40)return;A&&N.style.setProperty("width",`${A}px`,"important"),N.style.setProperty("height",O+"px","important")}else if("snapreview_post_focusmove_by_id"==i){var S=(R=s.frameid||null)&&document.getElementById(R)||null;S&&S.scrollIntoView()}else if("snapreview_close_popup"==i){if(!s.id)return;if(o=sfMakeIframeIdG(s.id),void 0!==(N=document.getElementById(o))&&null!=N&&(location.hash&&snaputil.history_back(),snaputil.close_popup(o)),a){const e=document.querySelectorAll("iframe[id^='review_widget']");e.length&&e.forEach((e=>{var t=e.id;snaputil.snapreview_sf_post_to_resultviewmessage({e:"popup-close",solutiontype:"snap_review"},t)}))}else window.postMessage({type:"popup-close",solutiontype:"snap_review"},"*")}else if("snapreview_redirect_url"==i){if("widgetid"in s&&-1!==window.location.hash.indexOf("#review_widget")&&(k=sfMakeIframeIdG(s.widgetid),snaputil.history_back(),snaputil.close_popup(k)),!(T=s.url))return;s.isLogin&&-1!==T.indexOf("=")&&(-1===snaputil.fit_base_domain.indexOf(window.location.href)?T+=window.location.href:document.referrer&&-1===snaputil.fit_base_domain.indexOf(document.referrer)&&(T+=document.referrer)),snaputil.redirect_url(T,s.post)}else if("sf_redirect_url"==i){var T;if(!(T=s.url))return;-1!==snaputil.fit_base_domain.indexOf(window.location.href)?T+=window.location.href:document.referrer&&-1!==snaputil.fit_base_domain.indexOf(document.referrer)&&(T+=document.referrer),snaputil.redirect_url(T,s.post)}else if("snapreview_set_cookie"==i){if(!s.data)return;g=s.platform,k=s.id,l=(x=s.data).name;var x,M=x.value,C=x.expire;if(!(g&&k&&l&&void 0!==M&&C))return;snapCookieInstance.setCookie(l,M,C.day,C.hours,C.minutes,C.seconds)}else if("refresh_mypage"==i){if(a){if(!s.widgetId)return;snaputil.snapreview_sf_post_to_resultviewmessage({e:"refresh_mypage",solutiontype:"snap_review"},sfGetIframeIdG(s.widgetId))}snaputil.isFunction(this.refreshPage)&&this.refreshPage(1)}else if("snapreview_scroll_evnet"==i){var N;o=sfMakeIframeIdG(s.value),(N=document.getElementById(o))&&N.scrollIntoView()}else if("snapreview_replace_frame"==i){if(!s.old_id)return;k=sfMakeIframeIdG(s.widgetid),o=sfMakeIframeIdG(s.old_id);var G=document.getElementById(o);if(!G)return;G.setAttribute("name",k),G.setAttribute("id",k)}else if("infinity_scroll_paging"==i)a&&(s.reviewobj=this),snaputil.infinite_paging(s);else if("not_infinity_scroll_paging"==i)a&&(s.reviewobj=this),snaputil.not_infinite_paging(s);else if("show_iframe"==i){if(!s.frameid)return;var R=sfGetIframeIdG(s.frameid),W=document.getElementById(R);W&&("makeshop"!==snaputil.sf_get_innertext("solutiontype")&&W.getAttribute("data-ifp")&&snaputil.disableLoading(),W.style.opacity="1",snaputil.isPC()&&snaputil.WIDGET_TYPE.MYPAGE_NOTI_POPUP==s.frameid&&snaputil.moveMypageNotiPopup(W,null,!0))}else if("open_review_detail_frame"==i){R=sfGetIframeIdG("open_widget_id"in s?s.open_widget_id:"3_0");var B=document.getElementById(R),L="",j={};if(B&&(L=B.src||B.getAttribute("data-url")||"",j=(j=B.getAttribute("data-params"))&&"string"==typeof j&&snaputil.decode_json(j)||{}),!L)return;Object.keys(j).length?(j.i="tibb",j.isContentReview="1"):(L=L.replace("&i=tiaa","&i=tibb"),L+="&isContentReview=1"),snaputil.redirect_url(L,j)}else if("my_review_update"==i){if(!s.widgetId)return;snaputil.snapreview_sf_post_to_resultviewmessage(s={e:"getScrollPage",solutiontype:"snap_review",data:{page:1}},sfGetIframeIdG(s.widgetId))}else if("refresh_mypage_order"==i){if(!s.order_id)return;if(a){if(!s.widgetId)return;return void snaputil.snapreview_sf_post_to_resultviewmessage({e:"refresh_mypage_order",solutiontype:"snap_review",data:{order_id:s.order_id}},sfGetIframeIdG(s.widgetId))}const e=t?.data?.order_id??"";snaputil.isFunction(this.refresh_mypage_order)&&this.refresh_mypage_order(e)}else if("refreshWriteablePage"==i){if(!s.order_id)return;if(a){if(!s.widgetId)return;return void snaputil.snapreview_sf_post_to_resultviewmessage({e:"refreshWriteablePage",solutiontype:"snap_review",data:{order_id:s.order_id}},sfGetIframeIdG(s.widgetId))}const e=t?.data?.order_id??"",i=this.TAB?.WRITABLE,n=this.TAB_INFO&&this.TAB_INFO[i]||{};this.isFunction(n.refresh)&&n.refresh(e)}else if("pushstate_parent"==i)snaputil.pushstate_history(s.pushstates);else if("window_open"==i)snaputil.window_open(s.url);else if("getScrollPage"==i)a||this.GetData(s.page||1,1);else if("refresh_widget"==i){if("tibb"===(t.data?.dac??null))return location.reload();let e=sfGetIframeIdG(t.data?.iframeId??null);const i=document.getElementById(e),n=i?.dataset??{},r=n.url??null;if(null===i||!r)return;document.querySelector(`.snap_widget[id='3'] iframe[name='${e}']`)&&e.includes("12")&&(e=sfGetIframeIdG("3_0")),snaputil.formSubmit({action:r,target:e,datas:snaputil.decode_json(n.params)||{}})}else if("blindRequest"==i)if(a){var D=document.querySelectorAll(`.snap_widget.${r} iframe`)||[];if(s.widgetId){const e=sfGetIframeIdG(s.widgetId),t=document.querySelector(`#${e}`);t&&(D=[...D]).push(t)}for(var F=0;Fa.abort()),15e3);for(const[e,t]of Object.entries(r))s.append(e,t);try{return window?.snap_csrf_token&&(n["X-CSRF-TOKEN"]=window.snap_csrf_token),await fetch(t,{method:i,headers:n,body:s,signal:a.signal})}catch(e){if("AbortError"===e?.name)throw new Error("Timeout after 15000ms");throw e}finally{clearTimeout(o)}},this.postForm=async function(e){return await snaputil.requestForm(Object.assign(e,{method:"POST"}))},this.initNotificationWidget=e=>{const t={url:snaputil.DRAW_URL.NOTIFICATION,id:sfMakeIframeIdG(snaputil.WIDGET_TYPE.NOTIFICATION),name:sfMakeIframeNameG(snaputil.WIDGET_TYPE.NOTIFICATION),params:e??{},height:"45px",position:e?.position??{bottom:0,left:0},transform:"translateX(calc(50vw - 50%))",isHideMallScroll:!1,isIframeFullPopup:!1};delete t.params.position,snaputil.drawIframePopup(t)},this.initMypageNotiPopup=e=>{const t="mobile"===e?.platform;let i={url:snaputil.DRAW_URL.MYPAGE_NOTI_POPUP,id:sfMakeIframeIdG(snaputil.WIDGET_TYPE.MYPAGE_NOTI_POPUP),name:sfMakeIframeNameG(snaputil.WIDGET_TYPE.MYPAGE_NOTI_POPUP),params:e??{},width:"400px",height:"80vh",position:{top:"0",right:snaputil.mypageNotiPopupInitPos},transform:"translateY(calc(50vh - 50%))",isHideMallScroll:!1,isIframeFullPopup:!1},n=null;t&&(i={...i,width:"100%",height:"100%",position:{top:0,right:0},transform:"none",isHideMallScroll:!0,isIframeFullPopup:!0}),n=snaputil.drawIframePopup(i),t||(n.style.transition="right 0.7s ease-in-out, opacity 0.3s linear",snaputil.moveMypageNotiPopup(n))},window.addEventListener("message",this.snap_sfreview_receiveMessage.bind(t||this),!1),window.addEventListener("popstate",this.popstate_eventlistener.bind(this))},window.snapCookieManager=window.snapCookieManager||function(){this.prefix="",this.setCookie=function(e,t,i,n,r,s){var a=new Date,o=document.domain.replace(/^www./,""),l=document.domain.replace(/^www./,"").replace(/^m./,"");a.setDate(a.getDate()+i),void 0!==n&&a.setHours(n),void 0!==r&&a.setMinutes(r),void 0!==s&&a.setSeconds(s),cookies=this.prefix+e+"="+escape(t)+"; path=/ ",void 0!==i&&(cookies+=";expires="+a.toGMTString()+";"),document.cookie=cookies+"Domain="+o,document.cookie=cookies+"Domain="+l},this.getCookie=function(e){e=this.prefix+e+"=";var t=document.cookie,i=t.indexOf(e),n="";if(-1!=i){i+=e.length;var r=t.indexOf(";",i);-1==r&&(r=t.length),n=t.substring(i,r)}return unescape(n)}},window.snapCookieInstance=window.snapCookieInstance||new snapCookieManager;